package com.ccx.coachsite.ui.manage;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ccx.coachsite.R;
import com.ccx.coachsite.bus.CustomInfo;
import com.ccx.coachsite.ui.own.OwerAdapterBase;

public class ManageCustomListAdapter extends OwerAdapterBase<CustomInfo>{
	
	public ManageCustomListAdapter(Context context, List<CustomInfo> list) {
		super(context, list);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if(convertView == null) {
			convertView = mInflater.inflate(R.layout.manage_custom_info_list_item, parent, false);
			holder = new ViewHolder();
			holder.nName = (TextView) convertView.findViewById(R.id.manage_custom_info_name);
			holder.nPhone = (TextView) convertView.findViewById(R.id.manage_custom_info_phone);
			holder.nMode = (TextView) convertView.findViewById(R.id.manage_custom_info_mode);
			convertView.setTag(holder);
		}else 
		{
			holder = (ViewHolder) convertView.getTag();
		}
		
		holder.nName.setText(mList.get(position).getName());
		holder.nPhone.setText(mList.get(position).getTianYi());
		holder.nMode.setText(mList.get(position).getMode());
		return convertView;
	}
	
	class ViewHolder {
		TextView nName;
		TextView nPhone;
		TextView nMode;
	}
}
